import 'package:flutter/material.dart';

class UserInfo with ChangeNotifier {
  num _counter = 10;
  String _brightness = "light";
  get counter => _counter;
  get brightness => _brightness;

  add() {
    _counter++;
    notifyListeners();
  }

  reduce() {
    _counter--;
    notifyListeners();
  }

  setbrightness(String b) {
    print('_brightness == $b');
    _brightness = b;
    notifyListeners();
  }
}

//1: 这里需要混入ChangeNotifier
//2: 写一个增加的方法，然后需要调用notifyListeners();这个方法是通知用到Counter对象的widget刷新用的。
//3: get方法
